package com.myblog.secondjavaproject;
import java.util.Scanner;
public class SkillTest {

        //	技能属性
        public static final String SKILLNORMAL = "一般";
        public static final String SKILLSTICK = "格斗";
        public static final String SKILLFLY = "飞行";
        public static final String SKILLDU = "毒";
        public static final String SKILLFLOOR = "地上";
        public static final String SKILLYANSHI = "岩石";
        public static final String SKILLBUG = "虫";
        public static final String SKILLYOULING = "幽灵";
        public static final String SKILLGANG = "钢";
        public static final String SKILLFIRE = "炎";
        public static final String SKILLWATOR = "水";
        public static final String SKILLCAO = "一草";
        public static final String SKILLLIGHT = "电";
        public static final String SKILLSUPERPOWER = "超能";
        public static final String SKILLICE = "冰";
        public static final String SKILLDRAGON = "龙";
        public static final String SKILLBAD = "恶";
        public static final String SKILLYAOGUAI = "妖";

        //  宠物属性
        public static final String PETNORMAL="一般";
        public static final String PETNORSTICK = "格斗";
        public static final String PETNORFLY = "飞行";
        public static final String PETNORDU = "毒";
        public static final String PETNORFLOOR = "地上";
        public static final String PETNORYANSHI = "岩石";
        public static final String PETNORBUG = "虫";
        public static final String PETNORYOULING = "幽灵";
        public static final String PETNORGANG = "钢";
        public static final String PETNORFIRE = "炎";
        public static final String PETNORWATOR = "水";
        public static final String PETNORCAO = "一草";
        public static final String PETNORLIGHT = "电";
        public static final String PETNORSUPERPOWER = "超能";
        public static final String PETNORICE = "冰";
        public static final String PETDRAGON = "龙";
        public static final String PETNORBAD = "恶";
        public static final String PETNORYAOGUAI = "妖";


        //暴击倍数
        public static int ZERO = 0;
        public static int HALF = 4;
        public static int NORMAL = 1;
        public static int DOUBLE = 2;

        /**
         *
         * @param skillType  技能的属性
         * @param petType 宠物的属性
         * @return 返回暴击的值
         */
        public static int getSkillValue(String skillType,String petType) {
            if (skillType.equals(SKILLNORMAL)) {
                if (petType.equals(SKILLYOULING)) {
                    return ZERO;
                } else if (petType.equals(SKILLYANSHI) || petType.equals(SKILLGANG)) {
                    return HALF;
                } else {
                    return NORMAL;
                }
            }

            if (skillType.equals(SKILLSTICK)) {
                if (petType.equals(SKILLYOULING)) {
                    return ZERO;
                } else if (petType.equals(SKILLFLY) || petType.equals(SKILLDU) || petType.equals(SKILLBUG) || petType.equals(SKILLSUPERPOWER) || petType.equals(SKILLYAOGUAI)) {
                    return HALF;
                } else if (petType.equals(SKILLNORMAL) || petType.equals(SKILLYANSHI) || petType.equals(SKILLGANG) || petType.equals(SKILLICE) || petType.equals(SKILLBAD)) {
                    return DOUBLE;
                } else {
                    return NORMAL;
                }
            }

            if (skillType.equals(SKILLFLY)) {
                if (petType.equals(SKILLYANSHI) || petType.equals(SKILLGANG) || petType.equals(SKILLLIGHT))
                    return HALF;
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLBUG) || petType.equals(SKILLCAO) || petType.equals(SKILLICE) || petType.equals(SKILLBAD))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLDU)) {
                if (petType.equals(SKILLDU) || petType.equals(SKILLFLOOR) || petType.equals(SKILLYANSHI))
                    return HALF;
                if (petType.equals(SKILLCAO) || petType.equals(SKILLYAOGUAI))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLFLOOR)) {
                if (petType.equals(SKILLBUG) || petType.equals(SKILLCAO))
                    return HALF;
                if (petType.equals(SKILLDU) || petType.equals(SKILLYANSHI) || petType.equals(SKILLGANG) || petType.equals(SKILLFIRE) || petType.equals(SKILLLIGHT))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLYANSHI)) {
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLFLOOR) || petType.equals(SKILLGANG))
                    return HALF;
                if (petType.equals(SKILLFLY) || petType.equals(SKILLBUG) || petType.equals(SKILLFIRE) || petType.equals(SKILLICE))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLBUG)) {
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLFLY) || petType.equals(SKILLDU) || petType.equals(SKILLYOULING) || petType.equals(SKILLGANG) || petType.equals(SKILLFIRE))
                    return HALF;
                if (petType.equals(SKILLCAO) || petType.equals(SKILLSUPERPOWER) || petType.equals(SKILLBAD))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLYOULING)) {
                if (petType.equals(SKILLNORMAL))
                    return ZERO;
                if (petType.equals(SKILLBAD))
                    return HALF;
                if (petType.equals(SKILLYOULING) || petType.equals(SKILLSUPERPOWER))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLGANG)) {
                if (petType.equals(SKILLGANG) || petType.equals(SKILLFIRE) || petType.equals(SKILLWATOR) || petType.equals(SKILLLIGHT))
                    return HALF;
                if (petType.equals(SKILLYANSHI) || petType.equals(SKILLICE) || petType.equals(SKILLYAOGUAI))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLFIRE)) {
                if (petType.equals(SKILLYANSHI) || petType.equals(SKILLFIRE) || petType.equals(SKILLWATOR) || petType.equals(SKILLDRAGON))
                    return HALF;
                if (petType.equals(SKILLBUG) || petType.equals(SKILLGANG) || petType.equals(SKILLCAO) || petType.equals(SKILLICE))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLWATOR)) {
                if (petType.equals(SKILLWATOR) || petType.equals(SKILLCAO))
                    return HALF;
                if (petType.equals(SKILLFLOOR) || petType.equals(SKILLFIRE) || petType.equals(SKILLYANSHI))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLCAO)) {
                if (petType.equals(SKILLFLY) || petType.equals(SKILLDU) || petType.equals(SKILLBUG) || petType.equals(SKILLGANG) || petType.equals(SKILLFIRE) || petType.equals(SKILLCAO) || petType.equals(SKILLDRAGON))
                    return HALF;
                if (petType.equals(SKILLFLOOR) || petType.equals(SKILLWATOR))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLLIGHT)) {
                if (petType.equals(SKILLFLOOR))
                    return ZERO;
                if (petType.equals(SKILLCAO) || petType.equals(SKILLLIGHT) || petType.equals(SKILLDRAGON))
                    return HALF;
                if (petType.equals(SKILLFLY) || petType.equals(SKILLWATOR))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLSUPERPOWER)) {
                if (petType.equals(SKILLBAD))
                    return ZERO;
                if (petType.equals(SKILLGANG) || petType.equals(SKILLSUPERPOWER))
                    return HALF;
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLDU))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLICE)) {
                if (petType.equals(SKILLBAD))
                    return ZERO;
                if (petType.equals(SKILLGANG) || petType.equals(SKILLFIRE) || petType.equals(SKILLWATOR))
                    return HALF;
                if (petType.equals(SKILLFLY) || petType.equals(SKILLFLOOR) || petType.equals(SKILLCAO))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLDRAGON)) {
                if (petType.equals(SKILLYAOGUAI))
                    return ZERO;
                if (petType.equals(SKILLGANG))
                    return HALF;
                if (petType.equals(SKILLDRAGON))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLBAD)) {
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLBAD) || petType.equals(SKILLYAOGUAI))
                    return HALF;
                if (petType.equals(SKILLYOULING) || petType.equals(SKILLSUPERPOWER))
                    return DOUBLE;
                return NORMAL;
            }

            if (skillType.equals(SKILLYAOGUAI)) {
                if (petType.equals(SKILLDU) || petType.equals(SKILLGANG) || petType.equals(SKILLFIRE))
                    return HALF;
                if (petType.equals(SKILLSTICK) || petType.equals(SKILLDRAGON) || petType.equals(SKILLBAD))
                    return DOUBLE;
                return NORMAL;
            }
        else{
            return NORMAL;
            }
        }

    public static void main(String [] args) {
            Scanner input = new Scanner(System.in);
            String skill = input.next();
            System.out.println(skill);
            String pet = input.next();
            System.out.println(pet);
            int ret = getSkillValue(skill,pet);
            System.out.println(ret);
    }

}

